package com.hj.service.impl;

import com.hj.dao.WorldDocumentDao;
import com.hj.domain.Tables;
import com.hj.service.WorldDocumentService;
import com.hj.util.DateToWordDocumentUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author hj
 */
@Service
public class WorldDocumentServiceImpl implements WorldDocumentService {

    @Resource
    WorldDocumentDao worldDocumentDao;

    @Resource
    DateToWordDocumentUtil dateToWordDocumentUtil;

    /**
     * 文件路径
     */
    @Value("${filePath}")
    private String filePath;

    /**
     * 获取数据
     */
    @Override
    public void getTableInfo(String dataName) {
        List<Tables> tables = worldDocumentDao.getAllTables(dataName);
        dateToWordDocumentUtil.dataToWorldDocument(tables, filePath);
    }

}
